import Vue from 'vue';
import { router } from './router/index';
import store from './store';
import Util from './libs/util';
import App from './app.vue';
import api from './api/index';

// 使用iview ui
import ViewUI from 'view-design';
import '@/theme/default.less';

// UI组件
import components from '@/components/index';

// 使用API接口地址管理
Vue.prototype.API = api;

Vue.use(ViewUI);
Vue.use(components);

new Vue({
    el: '#app',
    router: router,
    store: store,
    render: h => h(App),
    mounted() {
    	// 设置需要缓存的路由
    	this.$store.commit('initCachePage');
    	// 更新路由菜单
    	this.$store.commit('updateMenulist')
    }
});
